Skip to content

Support x-keep-typed-in-additional-properties in Java model generator#3971

Open
charlie-zhang109 wants to merge 2 commits into
masterfrom
czhang/typed-fields-in-additional-properties
Open

Support x-keep-typed-in-additional-properties in Java model generator#3971
charlie-zhang109 wants to merge 2 commits into
masterfrom
czhang/typed-fields-in-additional-properties

Conversation

@charlie-zhang109

Copy link
Copy Markdown

What does this PR do?

When a schema sets x-keep-typed-in-additional-properties: true (introduced in DataDog/datadog-api-spec#5941), each typed property setter in the generated Java model also calls putAdditionalProperty(JSON_PROPERTY_..., value). Previously, only unknown properties reached @JsonAnySetter and populated additionalProperties; typed Jackson properties did not.

The first consumer is UsageSummaryDate, UsageSummaryDateOrg, and UsageSummaryResponse. After this change, every field on those models is accessible via getAdditionalProperty(key) alongside untyped fields.

Typed getters are unchanged — this is additive only.

Companion PRs:

Review checklist

  • This PR includes all newly recorded cassettes for any modified tests.

  • This PR does not rely on API client schema changes.

    • The CI should be fully passing.
  • Or, this PR relies on API schema changes and this is a Draft PR to include tests for that new functionality.

When a schema sets `x-keep-typed-in-additional-properties: true`, each typed
property setter also calls putAdditionalProperty so all fields are accessible
via getAdditionalProperties() alongside untyped fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
charlie-zhang109

This comment was marked as resolved.

…itionalProperties

Generating the putAdditionalProperty call when additionalProperties is false
would cause a compile error because putAdditionalProperty is only generated
for models that have an additionalProperties schema.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@charlie-zhang109 charlie-zhang109 marked this pull request as ready for review June 8, 2026 15:23
@charlie-zhang109 charlie-zhang109 requested review from a team as code owners June 8, 2026 15:23
@datadog-datadog-prod-us1-2

Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

Ensure labels | changelog   View in Datadog   GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f30eacb | Docs | Datadog PR Page | Give us feedback!

@charlie-zhang109 charlie-zhang109 added the changelog/Added Added features results into a minor version bump label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/Added Added features results into a minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant